home *** CD-ROM | disk | FTP | other *** search
/ Floppyshop 2 / Floppyshop - 2.zip / Floppyshop - 2.iso / diskmags / 4671-5.790 / dmg-5333 / tutorial / kit2game.txt < prev    next >
Text File  |  1995-08-10  |  14KB  |  317 lines

  1.                 THE  THIRD  DIMENSION
  2.  
  3.     3DKIT 2  TUTORIAL  GAME FOR BEGINNERS:  MISSION (IM)POSSIBLE
  4.     ------------------------------------------------------------
  5.                  PART  5
  6.  
  7. This issue we will add the necessary conditions to our Mission 1 area.
  8. We are also going to add several animbrushes.
  9.     
  10. To refresh your memory:
  11. ----------------------
  12. The purpose of this mission is to find 3 magnetic tablets to disable the
  13. laser barriers. There are teleports that will transport the player quickly
  14. from one place to another. Power crystals are hanging all over the place
  15. that will give the player more power when shot. On the other hand, walking
  16. too near to a laser barrier, the player will loose power.
  17.  
  18. I am now going to make several conditions and animbrushes for this Mission 
  19. and to immediately test the effects of it I load my area into the Mission 
  20. datafile and save it as 'Try.3wd'. When testing a datafile I try to have
  21. it saved as "clean" as possible, i.e save it before testing anything.
  22. Having experienced animations that didn't work correctly anymore after
  23. testing once or twice (while saving the datafile inbetween) made me do this. 
  24. I admit, it is a bit more work, but I avoid a lot of frustration by doing 
  25. it in this way.
  26.  
  27. I make a condition for Procedure 1. This is icon 1 under the word Missions.
  28. As I will let the player choose each mission at random, it is necessary
  29. that the Power and Credits are updated each mission to their default
  30. values. To still be able to add all the Credits earned during the missions,
  31. I will have to reserve a variable which will count the number of missions
  32. successfully played. When all 5 missions have been successfully played, a 
  33. message should appear on the screen and the number of credits should then 
  34. be 500. This variable will be used later on in the game. For now, here is 
  35. the condition for Procedure 1:
  36.  
  37.   PC                                             AMIGA/ATARI
  38.       
  39.   SOUND (1)                                      SOUND (4)
  40.   CLEARSCREEN                                    DELAY (50)
  41.   LOADWORLD ("A:\\3DKIT2\\MISSION1.3WD")         SETVAR (2000,V31)
  42.                          SETVAR (0,V32)
  43.                          UPDATEI (1)
  44.                          UPDATEI (2)
  45.                          GOTO (1,3)                                   
  46.       
  47. On the Amiga/Atari this condition is almost the same as the first lines in
  48. the Initial Condition. Added is the GOTO command to transport the player to
  49. the correct area.
  50.  
  51. On the PC the LoadWorld command enables you to connect a complete datafile
  52. to the existing one. The information of the existing datafile however will
  53. be lost. But this doesn't matter because the same necessary conditions are
  54. present in the connected datafile, because for each mission area I will 
  55. use the original datafile, including the Choice area with its conditions, 
  56. and add the relevant area to it. So we don't need to (re)set the variables
  57. again because the Initial Condition will automatically perform this. In 
  58. order to be able to add all the credits earned during the different missions
  59. there is one variable on the PC that doesn't reset when using the LoadWorld
  60. command. This variable is the number 255. I will introduce this variable
  61. when we have completed the creation of 2 missions.
  62.  
  63. A short explanation on the LoadWorld command:
  64. When using this command on the PC, it is necessary to add 2 backslashes.
  65. The first "\" is used as a control code. To get a true backslash you
  66. must enter two into the string. See the above command. 
  67. (This information was given to me by Paul Gregory during playtesting 
  68. the PC Kit2 version.)
  69. I have used the command to be executed on the disk in the a: drive. When
  70. you copy the datafiles to your harddisk you have to change the command
  71. using c:\\ instead of a:\\ and fill in the correct directory(ies) in which
  72. the program can find your datafiles.
  73.  
  74.  
  75. Before testing the above conditions, I save my datafile. After testing, 
  76. I 'CLEAR ALL' and load the 'clean' datafile (try.3wd) again.
  77.  
  78. I want to use two animbrushes. The first one will be used for the laser
  79. barriers (sensors) and should appear as some sort of laserbeam. The second 
  80. one applies to all 5 missions and will be that of a dying soldier (when a 
  81. mission is not correctly completed).
  82. To create an animbrush in Kit 2, I will first have to cut the brushes from 
  83. a previously made picture in my paint program. I use this picture both on 
  84. the Amiga and on the PC. On the Amiga the memory is not divided into two 
  85. chunks as is on the PC. Therefore I have enough memory to use all the 
  86. brushes of the soldier to create my animation. On the PC however my memory 
  87. for animbrushes is restricted to 16.340 bytes, so in order to make more
  88. than one animation I will have to make a selection of the brushes. As I
  89. will use a third one for another mission, I also must have some memory
  90. left.
  91.  
  92. Some remarks about the PC memory chunks in comparison with the AMIGA/
  93. ATARI:
  94. To see the memory you have available on the PC, you click the down arrow to
  95. the left of the words   MODE        in the Edit/Movement Window below
  96.             OBJECT      the view window.
  97.             OBJPOS
  98. Click until you see the words: Free Memory 1
  99.                    Free Memory 2
  100.                    System Memory
  101. The first memory amount is used for creating your world (i.e. objects,
  102. animations, conditions, etc). You can check how much memory is left
  103. anytime (on the AMIGA/ATARI this memory is used for all actions in
  104. Kit2 and it can even be made larger by increasing the Buffer size).
  105.  
  106. The second memory is used for cutting brushes and making brushanimations.
  107. You can check how much of this memory you use when cutting your brushes
  108. and making brushanimations.
  109.  
  110. The System Memory is the overall memory which has a  connection with the 
  111. Conventional and Extended or Expanded memory of your PC. On the AMIGA it 
  112. is related to the Chip and RAM memory of AMIGA-DOS. 
  113. At a certain moment some actions cannot be performed anymore. For instance,    
  114. after editing a large condition text several times you suddenly cannot get
  115. access to it anymore. The only solution is: save your datafile, quit the 
  116. program and load it in again. Sometimes the program locks up (for no reason 
  117. it seems). I think one reason might be that being a very complicated program 
  118. in itself (using a lot of memory-intensive mathematics) it only allows you 
  119. a limited amount of memory for yourself. So being aware of this it is 
  120. very important to save your work regularly.
  121.  
  122. Cutting brushes is described very clearly in the Manual, pages 35/36 as
  123. is creating and making a brushanimation of it. There has also been an 
  124. article on this subject in issue 14 of our diskmag made by Tony. I have
  125. placed this article on this disk again so it shouldn't be that difficult
  126. now to make a brushanimation yourself. The brushanims are already 
  127. included into this month's datafile, but I also have placed the pictures on
  128. the disk, so you can practise it yourself.
  129.  
  130. In order for the brushanims to work correctly I have to edit the Initial
  131. Condition to make them invisible when the game is started.
  132. I also need a variable to count the magnetic tablets the player has to
  133. pick up. I pick V33 which will be set to zero in the Initial Condition.
  134. I pick V35 as a timer variable to use in a General Condition when 
  135. showing the brushanimation of the soldier. This will also be set to zero
  136. in the Initial Condition. 
  137. So at this moment I edit the Initial Condition as follows:
  138.              
  139.              DISABLEBRUSHANIM (1)
  140.              DISABLEBRUSHANIM (2)
  141.              SETVAR (2000,V31)                    
  142.              SETVAR (0,V32)                    
  143.              UPDATEI (1)
  144.              UPDATEI (2)
  145.              SETVAR (0,V33)
  146.              SETVAR (0,V35)
  147.  
  148. I edit Procedure 6, which is connected to the sensors. In it I will let
  149. the laserbeam brushanim appear and let the player loose Power.
  150.                  
  151.                  PROCEDURE 6
  152.            PC                           AMIGA/ATARI
  153.        ENABLEBRUSHANIM (1)               ENABLEBRUSHANIM (1)
  154.        STARTBRUSHANIM (1,105,85,2)       STARTBRUSHANIM (1,105,95,2)
  155.        SOUND (3)                         SUBVAR (1,V31)
  156.        SUBVAR (50,V31)
  157.  
  158. The brushanimation will start at x-coordinate 105 and y-coordinate 85 or
  159. 95 in single mode on screen but it will repeat itself as long as the
  160. sensor detects you. On the PC the sound is given in the Procedure, on the
  161. Amiga/Atari the sound is defined in the sensor's attributes window. The
  162. subvar condition is slightly different on the computers (I don't know why
  163. but in this way they both work the same amount of time).
  164.  
  165. I create a General Condition (nr. 1), which is valid for all 5 missions and 
  166. will count the Power variable V31. When it is lower than zero the Soldier
  167. brushanimation will start. In this condition I will use the variable V35
  168. as a timer together with the WAIT  NEXT command, because otherwise the 
  169. brushanim will go so fast that you hardly see it on screen. I will also 
  170. use another powerful command of Kit 2: the PSTRING command, which allows 
  171. you to let text appear on a x and y coordinate on screen. This command is 
  172. used together with the TEXTFONT and TEXTCOL(our) commands. I edit it as
  173. follows:
  174.  
  175.              GENERAL CONDITION 1
  176.  
  177.              IF VARLT? (V31,0)
  178.              THEN
  179.              SOUND (17)
  180.              GOTO (1,1)
  181.              DISABLEBRUSHANIM (1)  
  182.              FOR (V35,0,10)          
  183.              WAIT
  184.              NEXT
  185.              ENABLEBRUSHANIM (2)
  186.              STARTBRUSHANIM (2,120,90,2)
  187.              FOR (V35,0,2000)
  188.              WAIT
  189.              NEXT
  190.              TEXTFONT (1)
  191.              TEXTCOL (7,2)
  192.              PSTRING ("ALAS ..... YOU DIE .....",100,130)
  193.              SOUND (17)
  194.              DELAY (250)           (Amiga/Atari: DELAY (150))
  195.              DISABLEBRUSHANIM (2)                           
  196.              ENDGAME
  197.              ENDIF
  198.  
  199. There are also some conditions to make in the mission 1 area itself. I
  200. already made one object condition on the Power Crystals. I have to
  201. make another object condition on the Magnetic Tablets to add credits 
  202. to variable 32 when picked up and to add 1 number to variable V33
  203. until it reaches the number 3 when all three tablets have been picked
  204. up:
  205.  
  206.              IF ACTIVATED?
  207.              THEN INVIS (35)
  208.              ADDVAR (25,V32)
  209.              ADDVAR (1,V33)
  210.              SOUND (19)
  211.              ENDIF
  212.  
  213. One advantage in Kit2 is that you can save all your condition text files
  214. and load them into another condition when it has to contain the same
  215. contents.
  216. In this case I need the above condition 3 times, so this comes in handy.
  217. I have two other tablets, nr. 40 and 47, so when I load the condition 
  218. again, I have to change the number behind INVIS in line 2 into (40) 
  219. resp. (47). In order to let the player gain 100 credits, I will change 
  220. the addvar command in line 3 to (50,V32) when tablet nr. 47 is picked up.
  221.  
  222. When all 3 tablets have been picked up, variable 33 will read (V33,3). At
  223. that time all the laser barriers are to be disabled and the invisible
  224. exits should become visible. To accomplish this I will make use of a
  225. Local Condition (this condition is only valid in the area it has been
  226. created in). I create Local Condition nr. 1 and edit it as follows:
  227.  
  228.               IF VAREQ? (V33,3)
  229.               THEN 
  230.               DESTROY (52)
  231.               DESTROY (55)
  232.               DESTROY (57)
  233.               DESTROY (58)
  234.               DESTROY (59)
  235.               DESTROY (61)
  236.               DESTROY (67)
  237.               DESTROY (74)
  238.               DESTROY (76)
  239.               DESTROY (78)
  240.               DESTROY (79)
  241.               DESTROY (80)
  242.               DESTROY (82)
  243.               DESTROY (85)
  244.               VIS (51)
  245.               VIS (56)
  246.               VIS (60)
  247.               VIS (73)
  248.               VIS (77)
  249.               ENDIF
  250.  
  251. When this condition takes effect, the 5 exits in the area will be visible.
  252. They also need a condition to tell the player that the mission is success-
  253. fully completed and to transport him/her back to the Choice Area. This
  254. condition is as follows:
  255.              IF COLLIDED?
  256.              THEN
  257.              SOUND (6)
  258.              DELAY (50)
  259.              GOTO (1,1)
  260.              TEXTFONT (1)
  261.              TEXTCOL (7,2)
  262.              PSTRING ("LEVEL COMPLETED",60,100)
  263.              SOUND (9)
  264.              DELAY (250)
  265.              DESTROY (51,3)  exit1 in area 3
  266.              DESTROY (56,3)    " 2     "
  267.              DESTROY (60,3)    " 3     "
  268.              DESTROY (73,3)    " 4     "
  269.              DESTROY (77,3)    " 5     "
  270.              GOTO (1,2)
  271.              ENDIF
  272. I save this condition and load it into the conditions for the other 4
  273. exits. 
  274. NOTE:
  275. You may wonder why there are 5 exits in the area. Once the tablets
  276. are picked up there will (probably, not always) at least 1 be visible right 
  277. where the player stands. The only thing he/she has to do is collide with it 
  278. to complete the mission. However, the player can still walk through the maze 
  279. and shoot the power crystals to gain more power and exit through another 
  280. Entrance. This gives the possibility of adding a sort of bonus level to this 
  281. mission. I didn't do this in this tutorial but it might be an idea to try out 
  282. for yourself to add something personal to this game. It could also be possible
  283. to change the condition for the different exits so each of them gives
  284. access to another mission in the game. These are just some ideas that show 
  285. you how this game could also be made.
  286.  
  287. There is still one thing I have to do before the whole area is ready:
  288.  
  289. I will turn the Teleports into Transporters. I click on the attributes
  290. icon below the Edit Window and choose Teleport 2. I click on TRN and
  291. then on TRANSPORTER. Another window pops up in which you can fill in
  292. the Area and the Entrance to be transported to. This will be:
  293.      for Teleport 2          Area 3        Entrance 5
  294.      for Teleport 3          Area 3        Entrance 6
  295.      for Teleport 4          Area 3        Entrance 2
  296.      for Teleport 5          Area 3        Entrance 3
  297.      for Teleport 6          Area 3        Entrance 4
  298. I want to hear a sound when teleported so I also make a condition for
  299. the Teleports:
  300.               sound (6)
  301.               delay (50)
  302. I save this condition and load it into the condition for each Teleport.
  303.  
  304. I save the datafile (still as Test.3wd) and now I can really playtest it. 
  305. When everything works correctly and I am really convinced of that myself, 
  306. I clear the screen, load in the datafile again and save it as Missiona.3wd
  307. (AMIGA/ATARI) and Mission1.3wd (PC).
  308.  
  309. You now have a small game in itself that you can play and next issue we are
  310. going to create another mission.
  311. Happy computing!
  312.  
  313.                        Mieke
  314.  
  315.  
  316.  
  317.